var Twitter = {
	ajax: function(opt) {
		opt.id = Pref.UserId.get();
		opt.pw = Pref.Password.get();
		if (!opt.header) {
			opt.header = {};
		}
		opt.header["Accept"] = "text/xml";
		ajax(opt);
	},
	/*
	 * opt = {
	 * 	value/String,
	 * 	success/function,
	 * 	error/function
	 * }
	 */
	update: function(opt) {
		this.ajax({
			method: 'post',
			async: false,
			url: 'http://twitter.com/statuses/update.xml',
			data: 'status=' + encodeURI(opt.value),
			header: {
				"Content-type" : "application/x-www-form-urlencoded;charset=Shift-JIS",
			},
			success: opt.success,
			error: opt.error
		});
	},
	/*
	 * opt = {
	 * 	success/function,
	 * 	error/function
	 * }
	 */
	friendsTimeline: function(opt) {
		this.ajax({
			method: 'get',
			async: true,
			url: 'http://twitter.com/statuses/friends_timeline.xml',
			success: opt.success,
			error: opt.error
		});
	}
}
